home *** CD-ROM | disk | FTP | other *** search
- /* NAME:
- Shutdown.c
-
- WRITTEN BY:
- Dair Grant
-
- DESCRIPTION:
- This file contains a code resource to be installed as a Shutdown task.
-
- NOTES:
- On shutdown, we fade all the displays to black.
-
- ___________________________________________________________________________
- */
- //=============================================================================
- // Include files
- //-----------------------------------------------------------------------------
- #include "A4Stuff.h"
- #include "SetupA4.h"
- #include "Gamma.h"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- //=============================================================================
- // Private function prototypes
- //-----------------------------------------------------------------------------
- pascal void main(void);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- //=============================================================================
- // main : Entry point to our code resource.
- //-----------------------------------------------------------------------------
- // Note : We fade all the monitors down to black.
- //-----------------------------------------------------------------------------
- pascal void main(void)
- { long oldA4;
- short n;
-
-
- // Set up A4
- #ifndef powerc
- oldA4 = SetCurrentA4();
- #endif
-
-
-
- // Initialise the Gamma Tools library, and do nothing if we can't use it
- if (SetupGammaTools() == noErr)
- {
- if (IsGammaAvailable())
- {
- // If it all went OK, fade down slowly
- for (n = 100; n >= 0; n -= 3)
- DoGammaFade(n);
-
- DisposeGammaTools();
- }
- }
-
-
-
- // Restore A4 and return
- #ifndef powerc
- SetA4(oldA4);
- #endif
- }
-